package com.project.mapper.IPurchaseMapper;

import com.project.bean.PurchaseOrderBean;
import com.project.bean.ShopCarBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.Collection;
import java.util.List;

public interface IPurchaseOrderMapper {

    /**
     * 添加订单
     * @param order  订单对象
     */
    public void addPurchaseOrder(PurchaseOrderBean order);

    /**
     * 添加订单明细
     * @param orderId  订单ID
     * @param shopList  购物车集合
     */
    public void addPurchaseInfo(@Param("orderId") int orderId, @Param("shopList") Collection<ShopCarBean> shopList);

    /**
     * 按订单ID查询订单详情
     * @param orderId  订单ID
     * @return  采购详情对象
     */
    public PurchaseOrderBean findById(int orderId);

    /**
     * 分页动态查询订单信息
     * @param name  供应商
     * @param startDate  起始日期
     * @param endDate  结束日期
     * @return  分页对象
     */
    public List<PurchaseOrderBean> findByItem(@Param("name") String name, @Param("startDate") LocalDate startDate, @Param("endDate") LocalDate endDate);
}
